package dev.guide.gif;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import dev.guide.R;

public class GIFDemoActivity extends Activity implements OnClickListener {
	private GifView gifView;
	private boolean flag = true;

	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setContentView(R.layout.gif_demo);

		gifView = (GifView) findViewById(R.id.gifview_show);
		gifView.setGifImage(R.drawable.happy_pig);
		gifView.setOnClickListener(this);
	}

	public void onClick(View v) {
		if (flag) {
			gifView.showCover();
			flag = false;
		} else {
			gifView.showAnimation();
			flag = true;
		}
	}

	public void onDestroy() {
		super.onDestroy();
	}
}
